const path = require('path');

const sequelize = require('./seq');
const requireFilesInFolder = require('../../utils/folderFilesRequire');

require('./association');
(async function () {
  const modelPath = path.join(__dirname, '/model');
  await requireFilesInFolder(modelPath);

  try {
    await sequelize.sync({force: true});
    console.log('Tables synced successfully');
  } catch (error) {
    console.error('Error syncing tables:', error);
  }
})();
